package com.framework.modules.dataview.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.common.utils.PageUtils;
import com.framework.common.utils.Query;
import com.framework.modules.base.service.UserDoingService;
import com.framework.modules.dataview.dao.ViewUserInfoSpaceDao;
import com.framework.modules.dataview.entity.ViewUserInfoSpaceEntity;
import com.framework.modules.dataview.service.ViewUserInfoSpaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("ViewUserInfoSpaceService")
public class ViewUserInfoSpaceServiceImpl extends ServiceImpl<ViewUserInfoSpaceDao, ViewUserInfoSpaceEntity> implements ViewUserInfoSpaceService {

    @Autowired
    private UserDoingService userDoingService;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<ViewUserInfoSpaceEntity> page = this.selectPage(
                new Query<ViewUserInfoSpaceEntity>(params).getPage(),
                new EntityWrapper<ViewUserInfoSpaceEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public ViewUserInfoSpaceEntity getViewUserInfoSpace(Long uid) {
        return this.baseMapper.selectById(uid);
    }

}
